import request from '@/utils/request'

/**
 * @description: 获取学生个人成绩，也可用于获取学生个人的所有课程
 * @return {*} promise
 * @param studentId
 */
export function getGradeRecordsAPI_Student(studentId) {
  return request({
    url: '/gradeRecords/getByStudentId/' + studentId,
    method: 'GET',
  })
}

/**
 * @description: 通过课程id和学生id获取成绩单信息接口
 * @return {*} promise
 * @param courseId
 * @param studentId
 */
export function getCoursesExtAPI_Student(courseId,studentId) {
  return request({
    url: '/gradeRecords/' + courseId+'/'+studentId,
    method: 'GET',
  })
}

/**
 * @description: 通过学生id和课程id加入课程
 * @return {*} promise
 * @param data
 */
export function joinCourseAPI_Student(data) {
  return request({
    url: '/gradeRecords',
    method: 'POST',
    data
  })
}

/**
 * @description: 通过教师id获取教师名字
 * @return {*} promise
 * @param studentId
 */
export function getTeacherNameAPI_Student(studentId) {
  return request({
    url: '/teachers/' + studentId,
    method: 'GET',
  })
}
